#include <stdio.h>
#define N 10
struct student{
	char name[8];	/*姓名*/
	int age;	    /*年龄*/
	char job;	    /*职业或专业，用s或t表示学生或教师*/
	union {
		int Class;	/*班级*/
		char office[10];  /*教研室*/
	}depa;
}stu[N];
int main(){
	int i; int n;
	printf("\n请输入人员数(<10):\n");
	scanf("%d",&n);
	for(i=0;i<n;i++){				/*输入n个人员的信息*/
		printf("\n请输入第%d人员的信息：(name  age  job  class/office)\n",i+1);
		scanf("%s,%d,%c",stu[i].name, &stu[i].age, &stu[i].job);
		if(stu[i].job=='s')
			scanf("%d",&stu[i].depa.Class);
		else
			scanf("%s",stu[i].depa.office);
	}
	printf("name    age    job    Class/office");
	for(i=0;i<n;i++){				/*输出*/
		if(stu[i].job=='s')
			printf("%s %3d %3c %d\n",stu[i].name, stu[i].age, stu[i].job, stu[i].depa.Class);
		else
			printf("%s %3d %3c %s\n",stu[i].name, stu[i].age, stu[i].job, stu[i].depa.office);
	}
}
